package com.gqb.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.transaction.annotation.Transactional;

import com.gqb.dao.BaseDao;
import com.gqb.service.BaseService;
public class BaseServiceImpl<T> implements BaseService<T> {
		
	private BaseDao<T> dao;
	
	
	public BaseDao<T> getDao() {
		return dao;
	}
	
	public void setDao(BaseDao<T> dao) {
		this.dao = dao;
	}

	@Override
	public void delete(int id) {
		dao.delete(id);
	}

	@Override
	public T getById(int id) {
		return dao.getById(id);
	}

	@Override
	public List<T> findAll() {
		return dao.findAll();
	}

	@Override
	public List<T> findByIds(String[] ids) {
		return dao.findByIds(ids);
	}

	@Override
	public int save(T entity) {
		return dao.save(entity);
	}
	
	@Override
	public void update(T entity) {
		dao.update(entity);
	}

	@Override
	public List<T> find(String hql) {
		return dao.find(hql);
	}

	@Override
	public List<T> find(String hql, Object... objects) {
		return dao.find(hql, objects);
	}

	@Override
	public List<T> query(String hql) {
		return dao.query(hql);
	}

	@Override
	public List<T> query(String hql, int page, int pageSize) {
		return dao.query(hql, page, pageSize);
	}

	@Override
	public List<T> query(String hql, Object... objects) {
		return dao.query(hql, objects);
	}

	@Override
	public List<T> query(String hql, int page, int pageSize, Object[] objects) {
		return dao.query(hql, page, pageSize, objects);
	}

	@Override
	public List<T> createCriteria(int page, int pageSize,
			Map<String, Object> map) {
		return dao.createCriteria(page, pageSize, map);
	}

	@Override
	public List<T> createCriteria(Map<String, Object> map) {
		return dao.createCriteria(map);
	}

	@Override
	public int excudeSqlUpdate(String sql, Object... objects) {
		return dao.excudeSqlUpdate(sql, objects);
	}

	@Override
	public int update(String hql, Object... objects) {
		return dao.update(hql, objects);
	}

	@Override
	public List<T> pageQuery(String hql, int page, int pageSize,
			Object... objects) {
		return dao.pageQuery(hql, page, pageSize, objects);
	}


	@Override
	public int update(String hql) {
		return dao.update(hql);
	}

	@Override
	public int excudeSqlUpdate(String sql) {
		return dao.excudeSql(sql);
	}

	@Override
	public void saveOrUpdateAll(List<T> list) {
		dao.saveOrUpdateAll(list);
	}

	@Override
	public void saveOrUpdate(T entity) {
		dao.saveOrUpdate(entity);
	}

	@Override
	public void delete(T entity) {
		dao.delete(entity);
	}

}
